home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 3 / CD ACTUAL 3.iso / linux / sonido / xmix-2.000 < prev    next >
Encoding:
Text File  |  1995-09-09  |  1.6 KB  |  66 lines

  1. Patch to let you specify an alternate mixer for people 
  2. with more than one mixer.  Typical example might be
  3. xmix -device /dev/mixer1 -title 'Sound Blaster 16'
  4. If not specified, it works normally.
  5. Andrew <drewvel@eideti.com>
  6.  
  7. --- ../xmix.orig/xmix.c    Sat May 28 00:50:53 1994
  8. +++ xmix.c    Wed May  3 21:58:44 1995
  9. @@ -456,8 +456,29 @@
  10.    int scroll_sep, longway;
  11.    Widget version;
  12.    int supported;
  13. +  char mixer_name[32];
  14.  
  15. -  longway = (argc > 1 && strcmp(argv[1],"-l") == 0);
  16. +  {
  17. +    int i;    
  18. +    
  19. +    longway=0;
  20. +    strcpy(mixer_name, "/dev/mixer");    
  21. +
  22. +    i=1;
  23. +    while (i<argc) {
  24. +      if (strcmp(argv[i],"-l")==0) longway=1;
  25. +
  26. +      if (strcmp(argv[i],"-device")==0) {
  27. +    i++;
  28. +    if (i>=argc) {
  29. +      fprintf(stderr, "Error: no device specified\n");
  30. +      exit(1);
  31. +    }
  32. +    strcpy(mixer_name, argv[i]);
  33. +      }
  34. +      i++;      
  35. +    };
  36. +  }
  37.  
  38.    topLevel = XtVaAppInitialize (&app_context,
  39.       "XMix",            /* Application class */
  40. @@ -465,7 +486,8 @@
  41.       &argc, argv,        /* command line args */
  42.       NULL,            /* for missing app-defaults file */
  43.       NULL);            /* terminate varargs list */
  44. -
  45. +  
  46. +  
  47.    whole = MW ("whole", formWidgetClass, topLevel, NULL);
  48.    
  49.    sliders = MW ("sliders", formWidgetClass, whole, NULL);
  50. @@ -689,9 +711,12 @@
  51.    install_pixmaps ();
  52.  
  53.    /* Open the mixer device */
  54. -  mixer_fd = open ("/dev/mixer", O_RDWR, 0);
  55. -  if (mixer_fd < 0)
  56. -    perror ("Error opening mixer device"), exit (1);
  57. +  mixer_fd = open (mixer_name, O_RDWR, 0);
  58. +  if (mixer_fd < 0) {
  59. +    char msg[32];
  60. +    sprintf(msg, "Error opening mixer device %s", mixer_name);
  61. +    perror (msg), exit (1);
  62. +  }
  63.  
  64.    
  65.    if (ioctl(mixer_fd, SOUND_MIXER_READ_DEVMASK, &supported) == -1)
  66.